package com.ba.pojo;

import com.ba.pojo.Card;
import com.ba.util.CardComparator;

import java.util.ArrayList;
import java.util.List;

public class Player {
    private List<Card> cards=new ArrayList<>();
    private String name;
    public Player(String name){
        this.name=name;
    }
    public void receiveCard(Card card){
        cards.add(card);
    }
    public void showCards(){

        cards.sort(new CardComparator());
        System.out.println();
        System.out.print(name+":");
        for(Card every:cards){
            System.out.print(every+" ");
        }
        System.out.println();
    }


}
